/**
	Easy interface for Flash "cookies" i.e. SharedObjects.
	Access properties with get("propname") and set("propname", value).

	@author Chandler McWilliams
	@version 2005-12-27
*/

dynamic class timber.util.Cookie
{
	private var so;
	private var name;

// ===========================================================
// - CONSTRUCTOR
// ===========================================================
/**
	Constructor

	@param  aName Name of the cookie.
*/
	private function Cookie(aName:String) {
		name = aName;
		so = SharedObject.getLocal(name);
	}

			
// ===========================================================
// - ACCESSORS
// ===========================================================
	public function get(prop) {
		return so.data[prop];
	}
	
	public function set(prop, val) {
		so.data[prop] = val;
		so.flush();
	}	
}